{include file="index@public/header" /}
<style>
    .lwList{
        position: fixed;
        top: 5em;
        width: 100%;
    }
</style>
<div class = "lwList" ng-controller = "fsLiwuCtrl">
    <h4 class = "col-xs-12 text-center" style = "margin-bottom:2em;">{$meta_title}</h4>
    <div class = "row" ng-repeat = "data in datas">
        <div class = "col-xs-12" style = "border-bottom:1px solid #ddd;padding:.5em;">
            <div class = "col-xs-4 text-center" ng-click = "tiaoz(data.jieshou)"><img src = '{{data.touxiang}}' style = "width:3em;height:3em" onerror="javascript:this.src='__PUBLIC__/images/login-img.jpg'"/><p style = "margin-top:1em">{{data.username}}</p></div>
            <div class = "col-xs-2 col-xs-offset-4" ng-click = "dakai(data.id)">打开</div>
            <div class = "col-xs-2" ng-click = "shanchu(data.id)">删除</div>
        </div>
            <div class = "col-xs-12" style = "border-bottom:1px dashed #ddd;margin:1em;padding:.5em" ng-if="data.state">
                    <div class = "col-xs-4 text-center"><img src = "__PUBLIC__/images/login-img.jpg" style = "width:3em;height:3em"/></div>
                    <div class = "col-xs-3 col-xs-offset-2">2个</div>
                <div class = "col-xs-3">4分</div>
                </div>
                </div>
                </div>
                <script type="text/javascript">
                    app.controller('fsLiwuCtrl', function($scope){
                        $scope.datas = JSON.parse( '<?php echo json_encode($lists);?>');
                        angular.forEach($scope.datas,function(data){
                            data.state  = false;
                        })
                        $scope.dakai = function(id){
                            angular.forEach($scope.datas,function(data){
                                id == data.id ? (data.state = !data.state):(data.state = false);
                            })
                        }
                        $scope.shanchu = function(id){
                            if(confirm('是否删除该条信息？')){
                                $.ajax({
                                    type: "post",
                                    url: '/index/oneself/scliwu',
                                    data: {'thisId':id},
                                    dataType: 'json',
                                    success: function (data){
                                        if(data.code){
                                            $.messager.show(data.msg, {placement: 'center',type:'success'});
                                            window.location.reload()
                                        } else {
                                            $.messager.show(data.msg, {placement: 'center',type:'failure'});
                                        }
                                    }
                                });
                             }
                         }
                         $scope.tiaoz = function(uid){
                             window.location.href='{:url("index/Oneself/selfDetail")}?id='+ uid ;//解析成功
                         }
                    })
</script>
{include file="index@public/selfFooter" /}